

import java.io.File;
import java.io.IOException;
import java.util.Date;

import org.apache.lucene.store.FSDirectory;

import com.edu.udistrital.indexing.Indexer;
import com.edu.udistrital.pdf.PdfToText;
import com.edu.udistrital.training.IndexToArffConverter;
import com.edu.udistrital.util.Configuration;

public class Principal {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String docsPath = "";

		Indexer indexer = new Indexer(Configuration.getInstance().getProperty("indexAprendizajePath"), Configuration.getInstance().getProperty("docsPath"), true);
//		Indexer indexer = new Indexer(Configuracion.getInstance().getProperty("indexCategorizacionPath"), docsPath, false);
		
		Date start = new Date();
//		try {
//			indexer.indexarDocumentos(Indexer.TipoIndexacion.APRENDIZAJE);
//		} catch (Exception e) {
//			e.printStackTrace();
//		} finally {
//			if (indexer != null) {
//				try {
//					indexer.close();
//				} catch (IOException e) {
//					e.printStackTrace();
//				}
//			}	
//		}
		
		
	    IndexToArffConverter indexToArffConverter = new IndexToArffConverter();
	    try {
//			indexToArffConverter.convertToArff(Configuracion.getInstance().getProperty("arffFile"), indexer.getDirectory());
	    	indexToArffConverter.convertToArff(Configuration.getInstance().getProperty("arffFile"), FSDirectory.open(new File(Configuration.getInstance().getProperty("indexAprendizajePath"))));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		Date end = new Date();
	    System.out.println(end.getTime() - start.getTime() + " total milisegundos");
	}

}
